package com.coder.oj.admin.dto;

import com.coder.oj.common.validate.ValidationGroups;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

@Data
public class ProblemDto implements Serializable {

    @ApiModelProperty("题目id")
    @NotNull(message = "题目id不能为空", groups = {ValidationGroups.Update.class})
    private Long id;

    @ApiModelProperty("题目标题")
    @NotBlank(message = "题目标题不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
    private String name;

    @ApiModelProperty("题目内容")
    @NotBlank(message = "题目内容不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
    private String content;

    @ApiModelProperty("运行内存")
    @NotNull(message = "运行内存不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
    private Long memoLimit;

    @ApiModelProperty("运行时间")
    @NotNull(message = "运行时间不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
    private Long timeLimit;

    @ApiModelProperty("题目难度")
    @NotNull(message = "题目难度不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
    private Integer difficulty;

    @ApiModelProperty("题目来源")
    private String source;

    @ApiModelProperty("测试样例")
    private List<KeyValueDto> cases;

    @ApiModelProperty("状态")
    @NotNull(message = "状态不能为空", groups = {ValidationGroups.Update.class})
    private Integer status;
}
